package com.lxj.mapper;

import com.lxj.domain.SysUser;
import com.lxj.dto.SysUserDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lxj
 * @date 2021/6/16 15:43
 */
public interface SysUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    /**
     * 根据用户名查找用户
     * @param username
     * @return
     */
    SysUser selectUserByName(String username);

    /**
     * 分页查询
     * @return
     */
    List<SysUser> selectUser(@Param("query") SysUserDto dto);

    /**
     * 根据身份证查询用户
     * @param idCard
     * @return
     */
    SysUser selectUserByIdCard(String idCard);

    /**
     * 根据电话查找用户
     * @param phone
     * @return
     */
    SysUser selectUserByPhone(String phone);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    int batchDelete(@Param("ids") Integer[] ids);
}